package worldinruin.controllers;

import static org.junit.Assert.*;

import org.junit.Test;

import worldinruin.core.imp.Troop;
import worldinruin.core.imp.soldiers.Archer;
import worldinruin.core.imp.soldiers.Catapult;
import worldinruin.core.imp.soldiers.Cavalier;
import worldinruin.core.imp.soldiers.Swordsman;

public class BattleControllerTest {

	@Test
	public void testRemoveCasualties() {
		
		Troop t = new Troop();
		BattleController bc = new BattleController();
		
		
		t.add(new Archer(), 20);
		t.add(new Cavalier(), 5);
		t.add(new Swordsman(), 15);
		t.add(new Catapult(), 2);
		
		bc.removeCasualties(t, 22);
		
		assertTrue(t.getAmount(new Archer()) == 0);
		assertTrue(t.getAmount(new Cavalier()) == 5);
		assertTrue(t.getAmount(new Swordsman()) == 13);
		assertTrue(t.getAmount(new Catapult()) == 2);
		
		
	}

}
